var g, app = getApp(), page = app.page, request = app.util.request, route = app.route, toast = app.toast,_tools = require("../../utils/tools");

page({
    data: {
        url: ""
    },
    watch:{
      userInfo:function(newValue){
        if(newValue){
        
        }
      }
    },
    onLoad: function(t) {
        let userInfo = wx.getStorageSync("userInfo")
        let url = decodeURIComponent(t.url)
        if(url.indexOf("chat.legalhhr.com") !== -1){
          url += "?type=1&user_id="+userInfo.id
        }
        getApp().setWatcher(this.data, this.watch);
        (g = this).setData({
            url
        });
        if(userInfo){
          request({
            url: "AddUsersLog",
            data: {
              user_id: userInfo.id,
              url: '/page/web/index',
              title: "聊天"
            },
            success: function(a) {
            }
          })
        }
    },
    onShow: function(t) {
      
    },
    onPullDownRefresh: function() {}
});